// mw.loader.implement will use globalEval if scripts is a string.
// Minify manually here, because general response minification is
// not effective due it being a string literal, not a function.
- if ( !self::inDebugMode() ) {
+ if ( !$context->getDebug() ) {
$scripts = self::filter( 'minify-js', $scripts ); // T107377
}
} else {
// Various parameters
$this->user = $request->getRawVal( 'user' );
- $this->debug = $request->getFuzzyBool(
- 'debug',
- $this->getConfig()->get( 'ResourceLoaderDebug' )
- );
+ $this->debug = $request->getRawVal( 'debug' ) === 'true';
$this->only = $request->getRawVal( 'only', null );
$this->version = $request->getRawVal( 'version', null );
$this->raw = $request->getFuzzyBool( 'raw' );
$options = [ 'lang' => $options ];
}
$options += [
+ 'debug' => 'true',
'lang' => 'en',
'dir' => 'ltr',
'skin' => 'vector',
];
$resourceLoader = $rl ?: new ResourceLoader();
$request = new FauxRequest( [
+ 'debug' => $options['debug'],
'lang' => $options['lang'],
'modules' => $options['modules'],
'only' => $options['only'],
'ResourceModuleSkinStyles' => [],
'ResourceModules' => [],
'EnableJavaScriptTest' => false,
- 'ResourceLoaderDebug' => false,
'LoadScript' => '/w/load.php',
] );
return new ResourceLoaderContext(
'output' => '<script async="" src="/w/load.php?debug=false&lang=nl&modules=test.scripts.raw&only=scripts&skin=fallback"></script>',
],
[
- 'context' => [ 'sync' => true ],
+ 'context' => [ 'sync' => '1' ],
'modules' => [ 'test.scripts.raw' ],
'only' => ResourceLoaderModule::TYPE_SCRIPTS,
'output' => '<script src="/w/load.php?debug=false&lang=nl&modules=test.scripts.raw&only=scripts&skin=fallback&sync=1"></script>',
'output' => '<script>(window.RLQ=window.RLQ||[]).push(function(){mw.loader.load("/w/load.php?debug=false\u0026lang=nl\u0026modules=test.user\u0026skin=fallback\u0026user=Example\u0026version=0a56zyi");});</script>',
],
[
- 'context' => [ 'debug' => true ],
+ 'context' => [ 'debug' => 'true' ],
'modules' => [ 'test.styles.pure', 'test.styles.mixed' ],
'only' => ResourceLoaderModule::TYPE_STYLES,
'output' => '<link rel="stylesheet" href="/w/load.php?debug=true&lang=nl&modules=test.styles.mixed&only=styles&skin=fallback"/>' . "\n"
. '<link rel="stylesheet" href="/w/load.php?debug=true&lang=nl&modules=test.styles.pure&only=styles&skin=fallback"/>',
],
[
- 'context' => [ 'debug' => false ],
+ 'context' => [ 'debug' => 'false' ],
'modules' => [ 'test.styles.pure', 'test.styles.mixed' ],
'only' => ResourceLoaderModule::TYPE_STYLES,
'output' => '<link rel="stylesheet" href="/w/load.php?debug=false&lang=nl&modules=test.styles.mixed%2Cpure&only=styles&skin=fallback"/>',